/*
 * This file is part of ksPlatform
 * 
 * Copyright (c) 2014-2015
 * 
 * This file is dual-licensed under the AGPLv3 (http://www.gnu.org/licenses/agpl-3.0.html) 
 * 
 * If you are unsure which license is appropriate for your use, please contact the sales department
 * at 97041437@qq.com.
 */
package cn.com.ksplatform.core.hsqldb;

import org.hsqldb.server.Server;

public class DbUtil {
	/**
	 * 启动本地数据库
	 */
	public static void runLocalDb(int port) {
		Server server = new Server();
		server.setDatabaseName(0, "ksPlatform");
		server.setPort(port);
		server.setDatabasePath(0, "./db/ksplatform");
		server.setSilent(true);
		server.start();

		try {
			Thread.sleep(800);
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
}
